<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE hibernate-mapping PUBLIC
    "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 
    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>
    <class name="cn.firstsoft.modules.workTask.domain.WorkTask" table="work_task">
      <id name="id" type="integer">
            <column name="id" />
            <generator class="native" >
				         <param name="sequence">WORK_TASK_ID_SEQ</param>
            </generator>
        </id>
        <property name="name" type="string">
               <column name="name" length="50" />
        </property>
        <property name="pid" type="integer">
               <column name="pid" length="50" />
        </property>
        <many-to-one name="type" class="cn.firstsoft.modules.workTask.domain.WorkTaskBaseInfo" fetch="select">
            <column name="type"/>
        </many-to-one>
         <many-to-one name="priority" class="cn.firstsoft.modules.workTask.domain.WorkTaskBaseInfo" fetch="select">
            <column name="priority"/>
        </many-to-one>
         <property name="status" type="string">
               <column name="status" length="50" />
        </property>
           <property name="codeNo" type="string">
               <column name="code_no" length="50" />
        </property>
        <property name="beginDate" type="timestamp">
               <column name="begin_date" length="23" />
        </property>
        <property name="endDate" type="timestamp">
            <column name="end_date" length="23"/>
        </property>
       <property name="actualBeginDate" type="timestamp">
            <column name="actual_begin_date" length="23"/>
        </property>
              
        <property name="actualEndDate" type="timestamp">
            <column name="actual_end_date" length="23"/>
        </property>
        <property name="rems" type="string">
               <column name="rems" length="50" />
        </property>
       <property name="budgetWorkHours" type="double">
               <column name="budget_work_hours"/>
        </property>
       <property name="actualWorkHours" type="double">
               <column name="actual_work_hours"/>
        </property>
       

        <set name="workTaskFile" lazy="true" inverse="false" cascade="save-update" batch-size="5">
            <key>
             <column name="work_task_id" not-null="true"/>
            </key>
            <one-to-many class="cn.firstsoft.modules.workTask.domain.WorkTaskFile"/>
        </set>
        
        <set name="workTaskItem" lazy="true" inverse="false" order-by="id desc" cascade="save-update" batch-size="5">
            <key>
             <column name="work_task_id" not-null="true"/>
            </key>
            <one-to-many class="cn.firstsoft.modules.workTask.domain.WorkTaskItem"/>
        </set>
        <many-to-one name="workTaskProject" class="cn.firstsoft.modules.workTask.domain.WorkTaskProject" fetch="select">
            <column name="work_project_id"/>
        </many-to-one>
        <many-to-one name="responsibilityUser" class="org.springside.modules.security.domain.User" fetch="select">
            <column name="responsibility_userid"/>
        </many-to-one>
         <many-to-one name="checkUser" class="org.springside.modules.security.domain.User" fetch="select">
            <column name="check_userid"/>
        </many-to-one> 
         <many-to-one name="createUser" class="org.springside.modules.security.domain.User" fetch="select">
            <column name="create_userid"/>
        </many-to-one>  
        <!--
            To add non XDoclet property mappings, create a file named
                hibernate-properties-WorkTask.xml
            containing the additional properties and place it in your merge dir.
        -->
    </class>
</hibernate-mapping>
